# -*- encoding: utf-8 -*-

"""
 构建三要素可转债文件并发送邮件
 
 Author: vx:18223205366
 
 Date: 2021/01/24 13:046
"""

import datetime

import ChangeMonitor
import PostWordpress
import ThreeElements3
from kzz.constants import MyConstant

if __name__ == '__main__':
    print('---kzz start---')

    time_stamp = datetime.datetime.now()
    print(time_stamp.strftime('%Y-%m-%d %H:%M:%S'))
    # 构建今日可转债文件
    now_data = ThreeElements3.get_three_elements3()
    # 发送email
    # SendMailAttachLinux.sendMail()
    message = ChangeMonitor.timing_monitor_all_time()
    # 更新文章
    content = str(MyConstant.HEADER_2) + '\n' + '\n'.join('%s' % id for id in now_data) + '\n' + message
    PostWordpress.edit_data(content, 67)

    print('---kzz over---')
